Repository navigation
Fix for #2009 (empty rectangle issue) - #2022
Conversation
|
Yeah this definitely contributes to the issue - we should have a common function for doing this rounding (it also happens inside the handle for the OnMouseMove event, which is inconsistent ) In my testing I was still able to occasionally get it to produce a zero-size rectangle, by tapping my laptop's trackpad while zoomed in. The logic in |
|
@cameronwhite I see. Maybe after these new changes it will work better |
|
Thanks! Having the common function is much nicer I can still reproduce the same issue though so I think it's somewhat separate from the rounding - being zoomed in far makes it much easier to hit. Maybe this needs to be handled at a lower level like BaseTool or the canvas event handlers though. Very likely there are other tools which also have similar assumptions that the "mouse up" event happens at the same position as the last "mouse move" event, and sending out an extra "mouse move" event could work? |
|
Hi again @cameronwhite. I added an extra check (see 87e01f7). We were only checking if the mouse was moved but we weren't checking if movement was in both X and Y. And to revisit: checking for |
|
Thanks, seems good in my testing 👍 |
Closes #2009
Notice that
OnMouseDownrounds the coordinates andOnMouseUpdoesn't, so when testing for equality the coordinates are different, which shouldn't happen